from flask import Flask, request, render_template
import SMSSend

app = Flask(__name__)


@app.route('/')
def index():
    return render_template("index.html")


@app.route('/bomber',methods=["POST"])
def bomber():
    phonenumber = request.form.get("phonenumber")
    try:
        print(SMSSend.send(int(phonenumber),30))
        return '发送成功(每分钟可以发送一次每次30条)<a href="/">返回首页</a>'
    except:
        return '发送失败,请输入正确的电话号<a href="/">返回首页</a>'


if __name__ == '__main__':
    app.run()
